# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-gunicorn
_pkgname=gunicorn
pkgver=20.0.0
pkgrel=1
pkgdesc="Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications."
url='https://github.com/benoitc/gunicorn/'
arch=('any')
license=('MIT')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('2b68af60d09f1770a0aa503ba459f9be83ca9495da50c95008ab07ccffafeca9189d48cf0150eed500ba2c5f773a7a8d9de0960ebab421558336585f9b7df3ed')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" -O1 --prefix=/usr --skip-build

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/$pkgname"
  mv "$pkgdir/usr/bin/${_pkgname}_paster" "$pkgdir/usr/bin/${pkgname}_paster"
}

